﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="otherroutebatchset.aspx.cs" Inherits="LTJ.WebPage.UserManage.route.otherroutebatchset" %>
<%@ Import Namespace="LTJ.Common" %>
<%@ Register TagPrefix="dyj" Namespace="LTJ.Control" Assembly="LTJ.Control" %>
<%@ Register TagPrefix="dyjU" TagName="ajaxcarrierlist" Src="~/datacontrol/ajaxcarrierlist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxroutelist" Src="~/datacontrol/ajaxroutelinelist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxcorplist" Src="~/datacontrol/ajaxcorplist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxcorpusersellist" Src="~/datacontrol/ajaxcorpusersellist.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>其他公司线路用户规则批量设置</title>
    <link href="../css/comm.css" type="text/css" rel="stylesheet" />
    <link href="../css/lightview.css" type="text/css" rel="stylesheet" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/prototype.js" type="text/javascript"></script>
    <script src="../js/scriptaculous.js?load=effects" type="text/javascript"></script>
    <script src="../js/lightview.js" type="text/javascript"></script>
    <script src="../js/effects.js" type="text/javascript"></script>
    <script src="../js/ajaxhelper.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/common.js"></script>
    <script src="../js/jquery-choose.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../js/modalpopup.js"></script>
    <script type="text/javascript">
        function Check(form, checked) {
            CheckByName(form, 'cid', checked);
            checkedEnabledButton(form, 'cid', 'setupdate');
        }
        function CheckSel(form, checked) {
            CheckByName(form, 'selid', checked);
            checkedEnabledButton(form, 'selid', 'selok');
        }
        function formcheck() {
            if (event.keyCode == 13) {
                document.getElementById("check").focus();
            }
        }
    </script>
    <style type="text/css">
	.chlt{ width:400px; height:auto; float:left;}
	.chlt li{ width:auto; height:20px; line-height:20px; border:1px solid #fff; margin:1px 0 0 1px; display:inline; float:left;}
	.chlt .hov{ border:1px solid #e4e4e4; cursor:pointer;}
	.chlt span{ padding:0 5px; float:left;}
	.chlt em{ width:20px; height:20px; background:url(../images/close.gif) right center no-repeat; float:left; display:none;}
	.chlt .hov em{ display:inline;}
	
	.chrt{ width:400px; height:auto; float:left;}
	.chrt li{ width:auto; height:22px; line-height:22px; background:#d9ecef; color:#52878f; padding:0 5px; margin:1px 0 0 1px; display:inline; float:left;}
	.chrt .hov{ background:#69b8c4; color:#fff; cursor:pointer;}
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="adnr">
	    <div class="adnrt">
		    <p class="mrt">起运港：<dyj:TextBox runat="server" ID="loadport" Width="100" MaxLength="20" onkeydown="formcheck()"></dyj:TextBox>&nbsp;</p>
            <p class="mrt">目的港：<dyj:TextBox runat="server" ID="destport" Width="100" MaxLength="20" onkeydown="formcheck()"></dyj:TextBox>&nbsp;</p>
            <div class="zi2 popxg mrt mtp" style="z-index:102">
                <p class="ip1" style="width:95px;" id="ajaxroutelinedatalist_str">航线</p>
                <input type="hidden" id="ajaxroutelinedatalist_value" name="ajaxroutelinedatalist_value"/>
                <span class="an"></span>
                <div class="cn" style="width: 246px;" id="ajaxroutelinedatalist_div">
                    <dyjU:ajaxroutelist runat="server" ID="aroutelist" />
                </div>
            </div>
            <div class="zi2 popxg mrt mtp" style="z-index:102">
                <p class="ip1" id="ajaxcarrierlist_str" style="width:95px;">船公司</p>
                <input type="hidden" id="ajaxcarrierlist_value" name="ajaxcarrierlist_value"/>
				<span class="an"></span>
				<div class="cn" style="width:246px;" id="ajaxcarrierlist_div">
                    <dyjU:ajaxcarrierlist runat="server" ID="acarrlist" />
				</div>
            </div>
            <div class="zi2 popxg mrt mtp" style="z-index:102">
				<p class="ip1" id="ajaxcorpdatalist_str" style="width:95px">报价公司</p>
                <input type="hidden" id="ajaxcorpdatalist_value" name="ajaxcorpdatalist_value" value=""/>
				<span class="an"></span>
				<div class="cn" style="width:400px;" id="ajaxcorpdatalist_div">
                    <dyjU:ajaxcorplist runat="server" ID="acorplist" />
				</div>
			</div>
            <p><dyj:Button runat="server" ID="check" Text="查询" ButtonImgUrl="../images/search.gif"/></p>
	    </div>
        <div class="adnrt">
            <p class="mrt">会员批量选择：</p>
            <div class="zi2 popxg mrt mtp" style="z-index:101">
                <p class="ip1" id="ajaxcorpuserseldatalist_str" style="width:200px">会员选择</p>
                <input type="hidden" id="ajaxcorpuserseldatalist_value" name="ajaxcorpuserseldatalist_value" value=""/>
				<span class="an"></span>
				<div class="cn" style="width:400px;" id="ajaxcorpuserseldatalist_div">
                    <dyjU:ajaxcorpusersellist runat="server" ID="acorpuserlist" />
				</div>
			</div>
        </div>
        <ul class="chlt" id="chlt">
		    <li>已选择会员：</li>
	    </ul>
         <ul class="adnrt mar_top">
            <button class="MgButton" id="setupdate" disabled="true" onclick="newMenu()"><img src="../images/mydocs.gif"/>批量调整</button>&nbsp;&nbsp;
	    </ul>
	    <div class="adnr3">
        <dyj:datagrid id="DataGrid1" runat="server" PageSize="10">
	       <Columns>
           <asp:TemplateColumn HeaderText="<input title='选中/取消' onclick='Check(this.form,this.checked)' type='checkbox' name='chkall' id='chkall' />">
                <HeaderStyle Width="20px" />
                <ItemTemplate>
                    <input id="cid" type="checkbox" onclick="checkedEnabledButton(form, 'cid', 'setupdate')" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString()%>" name="cid">
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作">
              <ItemTemplate>
                <a class="l_blue lightview" rel="iframe" title=" :: :: width:600,height:480" href="corproutedetail.aspx?rid=<%#DataBinder.Eval(Container, "DataItem.id")%>">详情</a>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="routenum" HeaderText="线路编号"></asp:BoundColumn>
            <asp:BoundColumn DataField="loadename" HeaderText="起运港"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="目的港">
              <ItemTemplate>
                <div class="hdiv" style="z-index:<%# 100-Container.ItemIndex %>;">
					<p class="tit"><%# DataBinder.Eval(Container, "DataItem.destename")%></p>
					<p class="hdv" style="width:120px;">
                        <span>所属航线:<%#DataBinder.Eval(Container, "DataItem.routeseaname")%></span>
                        <span>所属国家:<%#DataBinder.Eval(Container, "DataItem.countryname")%></span>
                        <span>中文名:<%#DataBinder.Eval(Container, "DataItem.destname")%></span>
                        <span>英文名:<%#DataBinder.Eval(Container, "DataItem.destename")%></span>
					</p>
				</div>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="船司">
              <ItemTemplate>
              <%# DataBinder.Eval(Container, "DataItem.routeid").ToString()=="0"?DataBinder.Eval(Container, "DataItem.bname"):DataBinder.Eval(Container, "DataItem.routebname")%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="tranename" HeaderText="中转港"></asp:BoundColumn>
            <asp:BoundColumn DataField="pier" HeaderText="码头"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="20GP">
              <ItemTemplate>
              <%# GetSeaPrce(((System.Data.DataRowView)Container.DataItem).Row, "20GP")%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="40GP">
              <ItemTemplate>
              <%# GetSeaPrce(((System.Data.DataRowView)Container.DataItem).Row, "40GP")%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="40HQ">
              <ItemTemplate>
              <%# GetSeaPrce(((System.Data.DataRowView)Container.DataItem).Row, "40HQ")%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="附加费用">
              <ItemTemplate>
                <div class="hdiv" style="z-index:<%# 100-Container.ItemIndex %>;">
					<p class="tit">AMS/ENS:<%# DataBinder.Eval(Container, "DataItem.AMS_ENS").ToString() == "" ? "0" : DataBinder.Eval(Container, "DataItem.AMS_ENS").ToString()%></p>
					<p class="hdv" style="width:120px;">
                        <span>文件费:<%#GetOtherPrice(DataBinder.Eval(Container, "DataItem.DOC").ToString(), 1)%></span>
						<span>AMS/ENS:<%#GetOtherPrice(DataBinder.Eval(Container, "DataItem.AMS_ENS").ToString(), 1)%></span>
						<span>THC:<%#GetOtherPrice(DataBinder.Eval(Container, "DataItem.THC").ToString(), 1)%></span>
						<span>箱单:<%#GetOtherPrice(DataBinder.Eval(Container, "DataItem.XSF").ToString(), 1)%></span>
					</p>
				</div>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="schbegin" HeaderText="截关"></asp:BoundColumn>
            <asp:BoundColumn DataField="schend" HeaderText="开船"></asp:BoundColumn>
            <asp:BoundColumn DataField="range" HeaderText="行程"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="有效期">
              <ItemTemplate>
              <%# Utils.GetStandardDate(DataBinder.Eval(Container, "DataItem.validbegin").ToString())%> - <%# Utils.GetStandardDate(DataBinder.Eval(Container, "DataItem.validend").ToString())%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="cname" HeaderText="报价提供"></asp:BoundColumn>
          </Columns>
	    </dyj:datagrid>
	    </div>
	    <i class="tp"></i><i class="bt"></i>
    </div>
    <div id="BOX_overlay" style="background: #000; position: absolute; z-index: 101; filter: alpha(opacity=50); -moz-opacity: 0.6; opacity: 0.6;">
    </div>
    <div id="neworeditmainmenu" style="display: none; background: #fff; padding: 10px; border: 1px solid #999; width: 400px;">
        <div class="ManagerForm">
            <fieldset>
                <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                    批量调整规则信息</legend>
                <table cellspacing="0" cellpadding="4" class="adtb" width="80%">
                    <thead>
                        <tr>
                            <td>20GP</td><td>40GP</td><td>40HQ</td>
                        </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>+<dyj:TextBox runat="server" ID="_20GPprice" RequiredFieldType="数据校验" MaxLength="10" Width="100"></dyj:TextBox></td>
                        <td>+<dyj:TextBox runat="server" ID="_40GPprice" RequiredFieldType="数据校验" MaxLength="10" Width="100"></dyj:TextBox></td>
                        <td>+<dyj:TextBox runat="server" ID="_40HQprice" RequiredFieldType="数据校验" MaxLength="10" Width="100"></dyj:TextBox></td>
                    </tr>
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="3" align="center">
                        <dyj:Button runat="server" ID="pricepost"/>
                            &nbsp;&nbsp;
                        <button class="MgButton" id="Button1" onclick="BOX_remove('neworeditmainmenu');"><img src="../images/del.gif"/>取 消</button>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </fieldset>
        </div>
    </div>
    <div id="setting" />
    <input type="hidden" id="epinfid" name="epinfid"/>
    <input type="hidden" id="infid" value="<%=companyinfo.Manager!=userid?userid:0%>"/>
    <button id="reclick" runat="server" style="display:none"></button>
    </form>
</body>
<script type="text/javascript">
    jQuery(document).ready(function () {
        choose("popxg");
        jQuery(".hdiv").find(".tit").hover(function () {
            var hdv = jQuery(this).next();
            if (hdv.is(':visible')) {
                hdv.slideUp();
            } else {
                hdv.slideDown();
            }
        });
        imgClick("chlt");
         <%if(companyinfo.Manager!=userid){%>AjaxHelper.Updater("ajaxcorpusersellist_list.ascx", "ajaxcorpuserseldatalist", "infid=<%=userid%>");<%}%>
    });

    function newMenu() {
        if(document.getElementById('epinfid').value == ""||document.getElementById('epinfid').value == ","){
            alert("请先选择要操作的用户！");
            return;
        }
        BOX_show('neworeditmainmenu');
    }

    function selectedAdmin(closediv){
        jQuery('#' + closediv + '_div').slideUp();
        var eninfids = checkedlistid('selid');
        var eninnames = checkedlistname('selid');

        if(eninfids!="") document.getElementById('epinfid').value = eninfids + (document.getElementById('epinfid').value!=""?(","+document.getElementById('epinfid').value):"");
        
        for(var i = 0;i < eninfids.split(',').length;i++){
            if(eninfids.split(',')[i]!=null&&eninfids.split(',')[i]!=""&&eninfids.split(',')[i]!="undifinded"){
                jQuery("#chlt").append("<li title='"+eninfids.split(',')[i]+"'><span>" + eninnames.split(',')[i] + "</span><em></em></li>");
            }
        }
        imgClick('chlt');
        AjaxHelper.Updater("ajaxcorpusersellist_list.ascx", "ajaxcorpuserseldatalist", "infid=" + (document.getElementById("infid") ? document.getElementById("infid").value : "0") + "&epinfid=" + (document.getElementById("epinfid") ? document.getElementById("epinfid").value : ""));
    }

     function checkedlistid(chkname) {
        var ids = jQuery("input:checked[name='" + chkname + "']");
        var prolist = Array();
        jQuery(ids).each(function () {
            prolist.push(jQuery(this).val().split('|')[1]);
        });
        return prolist.join(',');
    }

    function checkedlistname(chkname) {
        var ids = jQuery("input:checked[name='" + chkname + "']");
        var prolist = Array();
        jQuery(ids).each(function () {
            prolist.push(jQuery(this).val().split('|')[0]);
        });
        return prolist.join(',');
    }

    function imgClick(objl){
        var	yobjl = objl;
		if(yobjl != '') yobjl = '#' + yobjl;
		
		jQuery(yobjl).find("li").each(function() {
			var chrtli = jQuery(this);
			imgHover(chrtli);
            chrtli.find("em").click(function() {
                document.getElementById('epinfid').value=("," +document.getElementById('epinfid').value + ",").replace("," +chrtli.attr("title") + ",","").replace(",,",",");
                AjaxHelper.Updater("ajaxcorpusersellist_list.ascx", "ajaxcorpuserseldatalist", "infid=" + (document.getElementById("infid") ? document.getElementById("infid").value : "0") + "&epinfid=" + (document.getElementById("epinfid") ? document.getElementById("epinfid").value : ""));
				chrtli.remove();
			});
		});
	}

    function imgHover(obj){
		obj.hover(function() {
				jQuery(this).addClass("hov");
			},function(){
				jQuery(this).removeClass();
			});
	}
</script>
</html>